<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE  PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper >
    
    <insert id="insertSelective" >
		insert into ${table_name}
		<trim prefix="values (" suffix=")" suffixOverrides=",">
		    <#list model_column as model>
		    <if test="${model.columnName} != null">
				${'#{'}${model.columnName},jdbcType=${model.columnType}${'}'},
			</if>
		    </#list>
		</trim>
	</insert>
	
	<update id="updateByPrimaryKeySelective" parameterType="${package_model}.${table_name}">
		update ${table_name_small}
		<set>
			<#if model_column?exists>
		    <#list model_column as model>
		    <if test="${model.columnName?uncap_first} != null">
				${model.columnName?uncap_first} = ${'#{'}${model.columnName?uncap_first},jdbcType=${model.columnType?upper_case}${'}'},
			</if>
		    </#list>
		    </#if>
		</set>
		where ${pk_column.columnName?uncap_first} = ${'#{'}${pk_column.columnName?uncap_first},jdbcType=${pk_column.columnType?upper_case}${'}'}
	</update>
</mapper>